// api/exam.js
import server from "../util/request.js";

/**
 * 加载所有可用的检查项目
 */
export function loadAllExamItems() {
    return server({
        url: '/api/exam-items',
        method: 'get'
    })
}

/**
 * 加载指定病人的检查历史
 * @param {number} patientId
 */
export function loadPatientExams(patientId) {
    return server({
        url: `/api/patient-exams/${patientId}`,
        method: 'get'
    })
}

/**
 * 批量提交新检查
 * @param {object} data (
 * { patientId: 123, examItemIds: [1, 2, 3] }
 * )
 */
export function submitPatientExams(data) {
    return server({
        url: '/api/patient-exams/batch',
        method: 'post',
        data: data
    })
}